package com.anti.modular.commonutils.controller;

import com.anti.modular.commonutils.ExcelUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @Description TODO
 * @Author anTi
 * @Date 2021-6-1
 */
@Controller
@RequestMapping("/excel")
public class ExcelController {
    /**
     * 导出数据，使用map接收
     *
     * @param map
     * @param response
     * @throws IOException
     */
//    @PostMapping("/exportExcel")
//    public void exportExcel(@RequestBody Map<String, Object> map, HttpServletResponse response) throws IOException {
//        IPage<User> iPage = userService.getList((String) map.get("name"), (Integer) map.get("page"), (Integer) map.get("limit"));
//        ExcelUtils.exportExcel(iPage.getRecords(), (String) map.get("title"), (String) map.get("sheetName"), User.class, (String) map.get("fileName"), response);
//    }
}
